<?php

namespace app\common\Validate;

use think\Validate;

class BannerValidate extends Validate
{
	
	/**
	 * 验证规则
	 * @var [array]
	 */
	protected $rule = [
        'name|名称' => 'require',
        'image|图片' => 'require',
        'description|描述' => 'require',
        'url|跳转链接' => 'require',
        'id' => 'require',
        'msg' => 'require'
    ];

    /**
     * 添加
     * @Author   Yichen
     * @DateTime 2020-05-02T13:43:52+0800
     * @return   [type]                   [description]
     */
    public function sceneAdd()
    {
    	return $this->only(['name', 'description', 'url']);
    }

    /**
     * 修改
     * @Author   Yichen
     * @DateTime 2020-05-02T14:17:50+0800
     * @return   [type]                   [description]
     */
    public function sceneEdit()
    {
    	return $this->only(['name', 'description', 'url']);
    }


    /**
     * 禁用或启用
     * @Author   Yichen
     * @DateTime 2020-05-02T14:33:51+0800
     * @return   [type]                   [description]
     */
    public function sceneProOrEna()
    {
        return $this->only(['msg', 'id']);
    }
}